package com.yuexunit.operationman.nbsy.module.AfterOperation.ui.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;


import com.yuexunit.operationman.nbsy.R;
import com.yuexunit.operationman.nbsy.config.AppConfig;
import com.yuexunit.operationman.nbsy.module.AfterOperation.ui.Act_AfterOperation_Preview;

import org.kymjs.kjframe.ui.KJFragment;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by chenss on 2017/8/11 0011.
 */

public class Fragment_AO_Postoperation extends KJFragment {

    @Bind(R.id.frag_ao_01_01)
    TextView fragAo0101;
    @Bind(R.id.frag_ao_01_02)
    TextView fragAo0102;
    @Bind(R.id.frag_ao_02_01)
    TextView fragAo0201;
    @Bind(R.id.frag_ao_02_02)
    TextView fragAo0202;
    @Bind(R.id.frag_ao_03_01)
    TextView fragAo0301;
    @Bind(R.id.frag_ao_03_02)
    TextView fragAo0302;
    @Bind(R.id.frag_ao_04_01)
    TextView fragAo0401;
    @Bind(R.id.frag_ao_04_02)
    TextView fragAo0402;
    @Bind(R.id.frag_ao_05_01)
    TextView fragAo0501;
    @Bind(R.id.frag_ao_05_02)
    TextView fragAo0502;
    @Bind(R.id.frag_ao_06_01)
    TextView fragAo0601;
    @Bind(R.id.frag_ao_06_02)
    TextView fragAo0602;
    @Bind(R.id.frag_ao_07_01)
    TextView fragAo0701;
    @Bind(R.id.frag_ao_07_02)
    TextView fragAo0702;
    @Bind(R.id.frag_ao_08_01)
    TextView fragAo0801;
    @Bind(R.id.frag_ao_08_02)
    TextView fragAo0802;
    @Bind(R.id.frag_ao_09_01)
    TextView fragAo0901;
    @Bind(R.id.frag_ao_09_02)
    TextView fragAo0902;
    @Bind(R.id.textView3)
    TextView textView3;
    @Bind(R.id.frag_ao_10_01)
    TextView fragAo1001;
    @Bind(R.id.frag_ao_10_02)
    TextView fragAo1002;
    @Bind(R.id.frag_ao_11_01)
    TextView fragAo1101;
    @Bind(R.id.frag_ao_11_02)
    TextView fragAo1102;
    @Bind(R.id.frag_ao_12_01)
    TextView fragAo1201;
    @Bind(R.id.frag_ao_13_01)
    TextView fragAo1301;
    @Bind(R.id.frag_ao_time_01)
    TextView fragAoTime01;
    @Bind(R.id.frag_ao_time_02)
    TextView fragAoTime02;

    private Act_AfterOperation_Preview aty;
    protected View mMainView;

    @Override
    protected View inflaterView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
        aty = (Act_AfterOperation_Preview) getActivity();
        mMainView = inflater.inflate(R.layout.fragment_ao_postoperation, container, false);
        ButterKnife.bind(this, mMainView);
        return mMainView;
    }

    @Override
    protected void initData() {
        if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getAoVisitId() != null) {
            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getObTimeStr() != null) {
                fragAoTime01.setText(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getObTimeStr());
            }

            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getBreath().length()>0) {
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getBreath().equals("1"))
                {
                    fragAo0101.setText("是");
                }
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getBreath().equals("0"))
                {
                    fragAo0101.setText("否");
                }
            }

            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getTubes().length()>0) {
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getTubes().equals("1"))
                {
                    fragAo0201.setText("是");
                }
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getTubes().equals("0"))
                {
                    fragAo0201.setText("否");
                }
            }

            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getSteady().length()>0) {
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getSteady().equals("1"))
                {
                    fragAo0301.setText("是");
                }
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getSteady().equals("0"))
                {
                    fragAo0301.setText("否");
                }
            }

            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getSoreThroat().length()>0) {
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getSoreThroat().equals("1"))
                {
                    fragAo0401.setText("是");
                }
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getSoreThroat().equals("0"))
                {
                    fragAo0401.setText("否");
                }
            }

            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getVomit().length()>0) {
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getVomit().equals("1"))
                {
                    fragAo0501.setText("是");
                }
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getVomit().equals("0"))
                {
                    fragAo0501.setText("否");
                }
            }

            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getSound().length()>0) {
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getSound().equals("1"))
                {
                    fragAo0601.setText("是");
                }
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getSound().equals("0"))
                {
                    fragAo0601.setText("否");
                }
            }

            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getLowerBody().length()>0) {
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getLowerBody().equals("1"))
                {
                    fragAo0701.setText("是");
                }
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getLowerBody().equals("0"))
                {
                    fragAo0701.setText("否");
                }
            }

            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getBiopsy().length()>0) {
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getBiopsy().equals("1"))
                {
                    fragAo0801.setText("是");
                }
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getBiopsy().equals("0"))
                {
                    fragAo0801.setText("否");
                }
            }

            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getHeadache().length()>0) {
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getHeadache().equals("1"))
                {
                    fragAo0901.setText("是");
                }
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getHeadache().equals("0"))
                {
                    fragAo0901.setText("否");
                }
            }

            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getUrinaryRetention().length()>0) {
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getUrinaryRetention().equals("1"))
                {
                    fragAo1001.setText("是");
                }
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getUrinaryRetention().equals("0"))
                {
                    fragAo1001.setText("否");
                }
            }

            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getObDoctorSignUrl().length()>0) {
                    fragAo1101.setText(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(0).getObDoctorSign());
            }
        }

        if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getAoVisitId() != null) {
            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getObTimeStr() != null) {
                fragAoTime02.setText(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getObTimeStr());
            }

            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getBreath().length()>0) {
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getBreath().equals("1"))
                {
                    fragAo0102.setText("是");
                }
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getBreath().equals("0"))
                {
                    fragAo0102.setText("否");
                }
            }

            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getTubes().length()>0) {
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getTubes().equals("1"))
                {
                    fragAo0202.setText("是");
                }
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getTubes().equals("0"))
                {
                    fragAo0202.setText("否");
                }
            }

            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getSteady().length()>0) {
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getSteady().equals("1"))
                {
                    fragAo0302.setText("是");
                }
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getSteady().equals("0"))
                {
                    fragAo0302.setText("否");
                }
            }

            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getSoreThroat().length()>0) {
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getSoreThroat().equals("1"))
                {
                    fragAo0402.setText("是");
                }
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getSoreThroat().equals("0"))
                {
                    fragAo0402.setText("否");
                }
            }

            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getVomit().length()>0) {
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getVomit().equals("1"))
                {
                    fragAo0502.setText("是");
                }
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getVomit().equals("0"))
                {
                    fragAo0502.setText("否");
                }
            }

            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getSound().length()>0) {
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getSound().equals("1"))
                {
                    fragAo0602.setText("是");
                }
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getSound().equals("0"))
                {
                    fragAo0602.setText("否");
                }
            }

            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getLowerBody().length()>0) {
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getLowerBody().equals("1"))
                {
                    fragAo0702.setText("是");
                }
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getLowerBody().equals("0"))
                {
                    fragAo0702.setText("否");
                }
            }

            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getBiopsy().length()>0) {
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getBiopsy().equals("1"))
                {
                    fragAo0802.setText("是");
                }
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getBiopsy().equals("0"))
                {
                    fragAo0802.setText("否");
                }
            }

            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getHeadache().length()>0) {
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getHeadache().equals("1"))
                {
                    fragAo0902.setText("是");
                }
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getHeadache().equals("0"))
                {
                    fragAo0902.setText("否");
                }
            }

            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getUrinaryRetention().length()>0) {
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getUrinaryRetention().equals("1"))
                {
                    fragAo1002.setText("是");
                }
                if(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getUrinaryRetention().equals("0"))
                {
                    fragAo1002.setText("否");
                }
            }

            if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getObDoctorSignUrl().length()>0) {
                fragAo1102.setText(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisitObList().get(1).getObDoctorSign());
            }
        }

        if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisit().getDoctorSign()!=null&&AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisit().getDoctorSign().length()>0) {
            fragAo1201.setText(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisit().getDoctorSign());
        }

        if (AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisit().getAoOther()!=null&&AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisit().getAoOther().length()>0) {
            fragAo1301.setText(AppConfig.AFTEROPERATIONBEAN.getObject().getAoVisit().getAoOther());
        }
    }

}
